export function antSortToApiParams(sort?: Record<string, string>, filter?: Record<string, string[]>) {
  let moreQuery: Record<any, any> = {}
  if (sort) {
    const sortKeys = Object.keys(sort)
    if (sortKeys && sortKeys.length) {
      sortKeys.forEach((key) => {
        if (sort[key] != null && sort[key] !== undefined) {
          moreQuery.sort = key
          moreQuery.order = sort[key]
        }
      })
    }
  }
  if (filter) {
    const filterKeys = Object.keys(filter)
    if (filterKeys && filterKeys.length) {
      filterKeys.forEach(key => {
        if (filterKeys[key] != null && filterKeys[key] !== undefined) {
          moreQuery = {
            ...moreQuery,
            [key]: filterKeys[key][0]
          }
        }
      })
    }
  }
  return moreQuery
}
